package com.ysd.lis.controller.sta;


import com.ysd.common.Result;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.dto.sta.StaItemDictDto;
import com.ysd.lis.dto.sta.StaItemDictParam;
import com.ysd.lis.entity.sta.StaItemDictCritical;
import com.ysd.lis.service.sta.StaItemDictCriticalService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * cold_chain.sys_module 前端控制器
 * </p>
 *
 * @author prs
 * @since 2024-12-18
 */
@Api(tags = "标准危急值")
@RestController
@RequestMapping("/lis/sta/staItemDictCritical")
public class StaItemDictCriticalController extends BaseController {

    @Autowired
    StaItemDictCriticalService staItemDictCriticalService;

    @ApiOperation("获取危急值信息")
    @GetMapping("/findStaItemDictCritical")
    public Result findStaItemDictCritical(StaItemDictParam labItemDictCritical) {
        return staItemDictCriticalService.findStaItemDictCritical(labItemDictCritical);
    }

    @ApiOperation("删除危急值信息")
    @PostMapping("/deleteStaItemCritical")
    public Result deleteStaItemCritical(@RequestBody StaItemDictDto dto) {
        return staItemDictCriticalService.deleteStaItemCritical(dto);
    }

    @ApiOperation("批量新增或修改危急值信息")
    @PostMapping("/saveOrUpdateStaCritical")
    public Result saveOrUpdateStaCritical(@RequestBody List<StaItemDictCritical> staItemDictCriticals) {
        return staItemDictCriticalService.saveOrUpdateStaCritical(staItemDictCriticals);
    }

}
